package com.xquant.marketdata.marketdata.controller;

import com.github.pagehelper.PageInfo;
import com.xquant.marketdata.marketdata.service.DividendCurveService;
import com.xquant.marketdata.marketdata.service.TcmdtforwardSeriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

/**
 * 下拉框查询
 *
 * @author ershuai.zhao
 */
@RestController
@RequestMapping("dividendCurveController")
public class DividendCurveController {

    @Autowired
    private DividendCurveService dividendCurveService;
    @Autowired
    private TcmdtforwardSeriesService tcmdtforwardSeriesService;



    /**
     * 查询 债券信息
     */
    @ResponseBody
    @RequestMapping(value = "/queryDividendCurveInfoByPage.action")
    public PageInfo<Map> queryDividendCurveInfoByPage(@RequestParam Map<String, Object> param) {
        PageInfo<Map> pageInfo = dividendCurveService.queryDividendCurveInfoByPage(param);
        return pageInfo;
    }
    /**
     * 查询 债券分红
     */
    @ResponseBody
    @RequestMapping(value = "/queryDividendCurvePriceByPage.action")
    public PageInfo<Map> queryDividendCurvePriceByPageByPage(@RequestParam Map<String, Object> param) {
        PageInfo<Map> pageInfo = dividendCurveService.queryDividendCurvePriceByPage(param);
        return pageInfo;
    }


    /**
     * 测试导入
     */
    @ResponseBody
    @RequestMapping(value = "/test")
    public String importt() throws IOException {
        tcmdtforwardSeriesService.importQuote("","");
        return "success";
    }




}
